﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace NGen.Managers.Particle
{
	/// <summary>
	/// Abstract particle system class from which all particle systems must inherit
	/// </summary>
	public abstract class ParticleSystem
	{
		/// <summary>
		/// get or set the location of this particle system on the screen
		/// </summary>
		public Vector2 EmitterLocation { get; set; }

		/// <summary>
		/// the list of active particles which have been emitted
		/// </summary>
		protected readonly List<Particle> m_lParticles = new List<Particle>();

		/// <summary>
		/// the list of textures which a new particle can use
		/// </summary>
		protected readonly List<Texture2D> m_lTextures = new List<Texture2D>();

		/// <summary>
		/// update this particle emitter
		/// </summary>
		/// <param name="p_gameTime">snapshot of timing values</param>
		public abstract void Update(GameTime p_gameTime);

		/// <summary>
		/// draw this particle system
		/// </summary>
		/// <param name="p_spriteBatch">spritebatch which will render this particle</param>
		public abstract void Draw(SpriteBatch p_spriteBatch);

		/// <summary>
		/// generate a new particle
		/// </summary>
		/// <returns>the particle generated</returns>
		protected abstract Particle GenerateNewParticle();
	}
}
